package io.xxx.xbutler.sdk.request;

import com.alibaba.fastjson2.annotation.JSONField;
import io.xxx.xbutler.sdk.TanJingRequest;
import io.xxx.xbutler.sdk.response.SafetyVerifyCodeSignResponse;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Map;

/**
 * 扫码号登录提交安全验证码
 * <p>
 * 扫码号登录扫码成功后，若收到扫码号登录需安全验证回调，通过此接口将安全验证码提交。提交后将发起登录，对应登录结果通过登录成功回调1003或登录失败回调1004通知商家；
 */
@Data
@Accessors(chain = true)
public class SafetyVerifyCodeSignRequest implements TanJingRequest<SafetyVerifyCodeSignResponse> {

    @JSONField(name = "serial_no")
    private String serialNo;

    @JSONField(name = "validate_code")
    private String validateCode;

    @Override
    public String path() {
        return "/scrm/robot/safety-verify-code-sign";
    }

    @Override
    public Map<String, Object> params() {
        return Map.of(
                "serial_no", serialNo,
                "validate_code", validateCode
        );
    }

    @Override
    public Class<SafetyVerifyCodeSignResponse> responseType() {
        return SafetyVerifyCodeSignResponse.class;
    }

    @Override
    public String merchantName() {
        return "merchant_no";
    }
}
